<?php
	require_once '../func/admin_func.php';
	$course = new admin();
	if(isset($_POST['pager'])){
		$pager = $_POST['pager'];
	}else{
		$pager = 1;
	}
	$data = $course->GetTimeList();
	$n = count($data);
	$i = 0;
?>

<div id="main-wrapper">
<h1>时间信息管理</h1>
<div class="wide form">
</div>
</div>
<div id="user-account-grid" class="grid-view">
<div class="summary">共<?php echo $n;?>条.</div>
<table class="items">
<thead>
<tr>
	<th></th>
	<th id="user-account-grid_c1"><a href="">ID</a></th>
	<th id="user-account-grid_c2"><a href="">时令</a></th>
	<th id="user-account-grid_c3"><a href="">上课节次</a></th>
	<th id="user-account-grid_c4"><a href="">上课时间</a></th>
	<th id="user-account-grid_c4"><a href="">操作</a></th>
</tr>
</thead>
<tbody id="tbody">
<?php
	while($i<$n){
?>
<tr class="<?php if($i%2==0){echo "even";}else{echo "odd";}?>">
<td></td>
<td><?php echo $data[$i]['id'];?></td>
<td><?php echo $data[$i]['type'];?></td>
<td><?php echo $data[$i]['order'];?></td>
<td><?php echo $data[$i]['time_range'];?></td>
<td>
<a class="update" title="更新" href="#" onclick="operate('date',<?php echo $data[$i]['id'].",".$pager;?>,'update')"><img src="./images/update.png" alt="更新"></a> 
<a class="delete" title="删除" href="#" onclick="operate('date',<?php echo $data[$i]['id'].",".$pager;?>,'del')"><img src="./images/delete.png" alt="删除"></a></td></tr>
<?php $i++;}?>
</tbody>
</table>
</div>